//2009/08/18 18:26:22
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <math.h>
#include <sstream>
#include <algorithm>

using namespace std;

class AimToTen
{
public:
    int need(vector <int> marks)
    {
		int sum = 0;
		for(int i=0; i<marks.size(); i++)
			sum += marks[i];
		double aver = 1.0 * sum / marks.size();
		if(aver >= 9.5) return 0;
		else
			return 19 * marks.size() - 2* sum;// It's math.s
    }
};
